package com.android.plc.ui.control;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

import com.android.plc.CONST;
import com.android.plc.CONST.COMMAND;
import com.android.plc.R;

public class AudioControl extends DVDPlayControl implements OnClickListener
{
	private static final int OFFSET_5 = 5;

	private Button mFuncBtn;
	private Button mInputBtn;

	public AudioControl(Context context, ViewGroup view, int res_id)
	{
		super(context, view, res_id);
	}

	public AudioControl(Context context, ViewGroup view)
	{
		super(context, view, R.layout.control_amplifier);
	}

	@Override
	public void initView(ViewGroup view)
	{
		super.initView(view);

		mFuncBtn = (Button) view.findViewById(R.id.btn_func);
		mInputBtn = (Button) view.findViewById(R.id.btn_input);

		mFuncBtn.setOnClickListener(this);
		mInputBtn.setOnClickListener(this);
	}

	public void onClick(View v)
	{
		super.onClick(v);
		switch (v.getId())
		{
		case R.id.btn_func:
			sendCommand(OFFSET_5, COMMAND.ON, CONST.DEF_DATA, 0);
			break;
		case R.id.btn_input:
			sendCommand(OFFSET_5, COMMAND.OFF, 0, 0);
			break;
		default:
			break;
		}
	}
}
